<div class="layui-card">
    <div class="layui-card-body">

        <form class="layui-form" action="{:url('admin/system.mailer/savemailer')}" method="post" id="cp-form">

            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <li class="{if request()->action() == 'index'}layui-this{/if}">
                        <a href="{:url('admin/system.mailer/index')}">邮箱配置</a>
                    </li>
                    <li class="{if request()->action() == 'template'}layui-this{/if}">
                        <a href="{:url('admin/system.mailer/template')}?template_key=verification_code">数字验证码邮件模板</a>
                    </li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-row">
                        <div class="layui-col-md5 ">
                            <div class="layui-tab-item layui-show">

                                <div class="layui-form-item">
                                    <label class="layui-form-label"> 发件人  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="from_name" value="{$mailer.from_name|default='辰一'}" required lay-verify="required" placeholder="发件人" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">邮箱地址  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="from" value="{$mailer.from|default='13765895164@163.com'}"  placeholder="邮箱地址" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">SMTP服务器  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="host" value="{$mailer.host|default=''}"  placeholder="SMTP服务器" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">链接方式  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <select name="smtp_secure" id="">
                                            <option value="">默认</option>
                                            <option value="ssl" {eq name="mailer.smtp_secure" value="ssl"}selected{/eq}>ssl</option>
                                            <option value="tls" {eq name="mailer.smtp_secure" value="tls"}selected{/eq}>tls</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">SMTP服务器端口  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="port" value="{$mailer.port|default=''}"  placeholder="SMTP服务器端口" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">发件箱帐号  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="text" name="username" value="{$mailer.username|default=''}"  placeholder="发件箱帐号" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">发件箱密码  <span class="request-tips">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="password" name="password" value="{$mailer.password|default=''}"  placeholder="发件箱密码" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
                    <a href="javascript:;" class="layui-btn" onclick="mailer('{:url("admin/system.mailer/test")}')"> 测试邮件</a>
                </div>
            </div>
        </form>
    </div>
</div>
